﻿using _1_DBFirst;
using System;
using System.Windows.Forms;

namespace _4_encryption
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //string connStr = "metadata=res://*/BloggingModel.csdl|res://*/BloggingModel.ssdl|res://*/BloggingModel.msl;provider=System.Data.SqlClient;provider connection string=\";data source=LAPTOP-HKCH47DH;initial catalog=test;user id=sa;password=sbkj1234;MultipleActiveResultSets=True;App=EntityFramework\"";
            //AesHelper ah = new AesHelper();
            //textBox1.Text = ah.EncryptString(connStr);

            using (var db = new BloggingContext(BloggingContext.ConnectStr))
            {
                var blog = new Blogs { Name = "王五" };
                db.Blogs.Add(blog);
                db.SaveChanges();
            }
        }
    }
}
